package com.base.caselib;

import android.text.TextUtils;
import android.view.View;

import com.alibaba.android.arouter.facade.annotation.Route;
import com.base.caselib.databinding.ActivityPowermatterBinding;
import com.base.caselib.presenter.PowerMatterPresenter;
import com.base.caselib.view.PowerMatterView;
import com.base.commonlib.base.CBaseBarMvpActivity;

/**
 * Created by weikailiang on 2019/12/10.
 */
@Route(path = "/power/matter")
public class PowerMatterActivity extends CBaseBarMvpActivity<PowerMatterPresenter> implements PowerMatterView{

    private ActivityPowermatterBinding mBinding;
    @Override
    protected int getLayoutResource() {
        return R.layout.activity_powermatter;
    }

    @Override
    protected void init() {
        super.init();
        mBinding = (ActivityPowermatterBinding) mRootBinding;
        mPresenter = new PowerMatterPresenter(this,this);
        mPresenter.start();
        setBackNavigation();
        setBarTitle("权利义务告知书");

    }

    @Override
    protected void start() {
        mBinding.print.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                if (TextUtils.isEmpty(mBinding.name.getText())){
                    showMes("请输入姓名");
                    return;
                }
                mPresenter.getPowerPdf(mBinding.name.getText().toString(),"power");
            }
        });
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        mPresenter.release();
    }
}
